﻿<?php

use yii\db\Schema;
use yii\db\Migration;

class m150505_081812_creative extends Migration
{
    public function up()
    {
    	$this->alterColumn('{{%creative}}', 'format_id', " int(3) unsigned NOT NULL COMMENT '1 static-pic, 2 dynamic-pic, 3 swf, 4 txt, 5 flv, 6 mp4'");
    	$this->addColumn('{{%creative}}', 'advertiser_name', "varchar(128) DEFAULT NULL COMMENT '视频创意所属广告主' after advertiser_id");
    	$this->addColumn('{{%creative}}', 'form', "int(1) DEFAULT '0' COMMENT '0 banner, 1 video' after template_id");
    	$this->addColumn('{{%creative}}', 'duration', "int(10) unsigned NOT NULL DEFAULT '0' COMMENT '视频素材持续时长' after height");
    	

    }

    public function down()
    {
        $this->dropColumn('{{%creative}}', 'advertiser_name');
        $this->dropColumn('{{%creative}}', 'form');
        $this->dropColumn('{{%creative}}', 'duration');
    }
}
